feat: implement feature parity with jsonpath-js 0.3.0#4
feat: implement feature parity with jsonpath-js 0.3.0#4netjordanlee wants to merge 1 commit intoloilo:mainfrom
Conversation
loilo
left a comment
There was a problem hiding this comment.
Please preserve the pre-existing formatting (tab indentation) in all your edits. If your IDE supports the .editorconfig file which is in the project root, it should do so on its own.
I need this to be done before properly reviewing the PR again as currently, the diff is mostly a big blob of whitespace noise.
|
I had an extension in my editor that was unfortunately superseding this and converting the whitespace on save. This should be fixed now. |
|
I had to make some adjustments, but couldn't push them back into your PR, so I did those as a separate PR (#5) which includes your changes. All of this has been published as v0.3.0. There has been a small breaking change to the Thanks for your work on this! 🙂 |
Added the
pathSegments()method toJsonPathmirroring the only additional feature added injsonpath-js:0.3.0.Summary of changes
Nodeclass and related functions to use an array for the path property instead of a string.JsonPathclass:paths()method to return stringified paths usingconvert_path_segment_to_stringmethod.pathSegments()method to return path segments as arrays (excluding the root).runfunction to initialize the root node path as an array.types/node.phpto work with array-based paths.TraverseDescendantTest.phpto use array paths.